package com.ews.onlineexchange.model;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;

import com.ews.onlineexchange.enumType.RecordStatus;

/**审核通过后生成的记录
 * @author Administrator
 *
 */
@Entity
public class DeterminedRecordAuditHistory extends DataEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private RecordStatus	recordStatus;				//
	private boolean 		auditted;    			//表示此条历史记录是驳回还是通过
	private String			reason;					//驳回原因
	private Date   	    	auditDate;				//审核日期
	private String			submitUserCnname;		//
	private String 			auditedUserCnname;
	
	
	@Enumerated(EnumType.STRING)
	public RecordStatus getRecordStatus() {
		return recordStatus;
	}
	public void setRecordStatus(RecordStatus recordStatus) {
		this.recordStatus = recordStatus;
	}
	public boolean isAuditted() {
		return auditted;
	}
	public void setAuditted(boolean auditted) {
		this.auditted = auditted;
	}
	public String getReason() {
		return reason;
	}
	public void setReason(String reason) {
		this.reason = reason;
	}
	
	@Temporal(TemporalType.TIMESTAMP)
	public Date getAuditDate() {
		return auditDate;
	}
	public void setAuditDate(Date auditDate) {
		this.auditDate = auditDate;
	}
	public String getSubmitUserCnname() {
		return submitUserCnname;
	}
	public void setSubmitUserCnname(String submitUserCnname) {
		this.submitUserCnname = submitUserCnname;
	}
	public String getAuditedUserCnname() {
		return auditedUserCnname;
	}
	public void setAuditedUserCnname(String auditedUserCnname) {
		this.auditedUserCnname = auditedUserCnname;
	}
	
	@Transient
	public String getAudittedStr() {
		if(isAuditted()) {
			return "审核通过";
		}else {
			return "驳回";
		}
	}
	
	@Transient
	public String operationStr() {
		if(getRecordStatus().equals(RecordStatus.Initaling)) return "初始状态";
		else if(getRecordStatus().equals(RecordStatus.Deleted)) return "删除";
		else  return "保留";
	}
	
	
	
}
